package com.goldcn.sys.service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.goldcn.goods.dto.PageInfo;
import com.goldcn.sys.dao.SysColumnMapper;
import com.goldcn.sys.dao.SysTableMapper;
import com.goldcn.sys.dao.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class SysTableService {
    @Autowired
    SysTableMapper tableMapper;


    @Autowired
    SysColumnMapper sysColumnMapper;

    @Autowired
    SysUserMapper sysUserMapper;


    /**
     * 条件查询
     *
     * @param queryGoodsDto
     * @param pageNum
     * @param pageSize
     * @return
     */
    public Object selectTablePageCondition(Integer pageNum, Integer pageSize) {

//        String orderBy = "addTime";
//        String orderType = "desc";
//        String orderStr = "";
//        PageHelper.startPage(pageNum, pageSize);//分页初始化
//        Page page = (Page) tableMapper.listByCondition("");
//        PageInfo obj = new PageInfo(page, page.getPages(), page.getTotal());
//        return obj;

        Object object = sysUserMapper.selectById("e9ca23d68d884d4ebb19d07889727dae");

        return object;
    }



    /**
     * 条件查询
     *
     * @param queryGoodsDto
     * @param pageNum
     * @param pageSize
     * @return
     */
    public Object selectColumnPageCondition(String id, Integer pageNum, Integer pageSize) {

        String orderBy = "addTime";
        String orderType = "desc";
        String orderStr = "";
        PageHelper.startPage(pageNum, pageSize);//分页初始化
        Page page = (Page) sysColumnMapper.listByCondition(id);
        PageInfo obj = new PageInfo(page, page.getPages(), page.getTotal());
        return obj;
    }


}
